1. Field of the Invention
The present invention relates to an apparatus and method for coding a moving picture and more particularly, to an apparatus and method of coding a moving picture in interframe mode.
2. Description of the Prior Art
When a moving picture coding apparatus compresses a moving picture, it is required to control the quantity of generated codes in order to prevent an overflow or underflow from occurring in a buffer of the moving picture decoding apparatus. The underflow can be easily avoided by stuffing dummy data when the quantity of generated codes decreases. On the other hand, the overflow can be suppressed generally by using, for example, a method that performs re-compression with a rough quantization or a method that forcefully changing data of non-zero, which was to be coded, to data of zero when the quantity of generated codes increases.
JP 09-252477A discloses an apparatus which rearranges the data of a plurality of macroblocks in a order frequency before coding the data. When the quantity of codes reaches a predetermined value, the apparatus replaces the remaining frequency components to zero.
JP 06-06783A discloses a technology for splitting frequency converted data into a plurality of frequency bands and weighting them to cut off high frequency components when an overflow is apt to occur.
However, the above recompression has a disadvantage that a processing time is increased and the above forceful discontinuation of coding conspicuously degrades image quality.
In the technology disclosed in JP 09-252477A a single upper limit frequency is applied to plural macroblocks. Therefore, the more high frequency components a block has, the more frequency components to be cut there are. This causes block distortion disadvantageously.
In the technology disclosed in JP 06-006783A, if there is an isolated high-frequency component having a large value it is weighted with a low value. Therefore, the isolated high frequency component changes to zero even if the component is important. This may often cause a noise in a picture.
JP 06-284409A, JP 06-284408A and JP 04-343578A also disclose the similar technologies in respect to cutting off components in high frequency regions notwithstanding the values of the components.
The present invention has an object to provide a moving picture coding apparatus and method capable of compressing moving pictures so that a bit rate of output codes never exceeds a target bit rate and so that noises in a decoded image such as a block distortion can be reduced.
According to a first aspect of the present invention, there is provided a moving picture coding apparatus for predictively coding moving picture data, comprising: a means for converting prediction errors of a plurality of pixel data into frequency components on a block basis; a quantizer for quantizing the converted prediction errors with reference to a quantization table; a dequantizer for dequantizing the quantized prediction errors with reference to another quantization table; a coder for coding the quantized prediction errors to generate codes; an output buffer for buffering the codes; a buffer check means for checking a code occupied ratio in the output buffer; a plurality of quantization tables; and a quantization table selecting means for selecting one quantization table from the plurality of quantization tables in accordance with the code occupied ratio, wherein the dequantizer employs a quantization table determined for the group of pictures.
The quantization table selecting means may perform selecting one quantization table on a macroblock basis.
According to a second aspect of the present invention, there is provided a moving picture coding method of predictively coding moving picture data, comprising the steps of: convering prediction errors of a plurality of pixel data into frequency components on a block basis; quantizing the converted prediction errors with references to a quantization table; dequantizing the quantized prediction errors with reference to another quantization table; coding the quantized prediction errors to generate codes; buffering the codes at an output buffer; checking a code occupied ratio in the output buffer; and selecting one quantization table from a plurality of quantization tables in accordance with the code occupied ratio, wherein the selected one quantization table is employed for quantization in the step of quantizing, and wherein a quantization table determined for a group of pictures is employed for dequantization in the step of dequantizing.
The step of selecting may be performed on a macroblock basis.
According to a third aspect of the present invention, there is provided a recordable medium on which a computer program is recorded, the computer program comprising instructions for causing a computer to execute a moving picture coding method for predictively coding moving picture data, the method comprising the steps of: converting prediction errors of a plurality of pixel data into frequency components on a block basis; quantizing the converted prediction errors with reference to a quantization table; dequantizing the quantized prediction errors with reference to another quantization table; coding the quantized prediction errors to generate codes; buffering the codes at an output buffer; checking a code-occupied ratio in the output buffer; and selecting one quantization table from a plurality of quantization tables in accordance with the code occupied ratio, wherein the selected one quantization table is employed for quantization in the step of quantizing, and a quantization table determined for a group of pictures is employed for dequantization in the step of dequantizing.
The step of selecting may be performed on a macroblock basis.